1. Field of the Invention
The present invention relates to a wave-shaping circuit for arbitrarily wave-shaping and outputting an input analog signal more particularly, it relates to an improvement of a circuit for wave-shaping a signal outputted as an alternating analog signal, such as a crank angle signal sampled through an electromagnetic pickup to monitor a number of engine revolutions, into a binary signal which accurately corresponds with the alternating period of the analog signal, such a wave-shaping circuit is useful in an electronic control system of an engine mounted in a vehicle or the like.
2. Description of Related Art
An electronic control system of an engine is known in the art as shown in FIG. 12.
In FIG. 12, a signal rotor 1 rotates in synchronism with a cam shaft of a four-cylinder engine. As shown in the figure, the signal rotor 1 has four projections 2a, 2b, 2c and 2d for detecting a crank angle at regular intervals per 90.degree. (180.degree. CA (cam shaft angle)) on the outer periphery thereof. Those projections 2a, 2b, 2c and 2d are formed as conical projections made from an appropriate magnetic substance.
An electromagnetic pickup 3 is disposed in the vicinity of the signal rotor 1 to detect passages of the projections 2a, 2b, 2c and 2d as the signal rotor 1 rotates. This electromagnetic pickup 3 is constructed by winding a coil (not shown) around a core (not shown) made from an appropriate magnetic substance.
A wave-shaping circuit 4 wave-shapes an alternating analog signal induced by the electromagnetic pickup 3 as the signal rotor 1 having the projections 2a, 2b, 2c and 2d rotates into a binary signal which corresponds to an alternating period of the alternating analog signal. Normally the circuit 4 wave-shapes such alternating analog signal by comparing with a comparison reference signal by a comparator. The signal wave-shaped into the binary signal is inputted a microcomputer (CPU) 5.
An A/D converter 6 is a circuit for converting analog signals which correspond respectively with an "engine water temperature" and a "battery voltage" input through other sensors (not shown) disposed at various parts of the engine into digital signals. Those analog signals are converted into the digital signals on the basis of an A/D conversion command issued from the microcomputer (CPU) 5 together with a specification of a conversion channel thereof (specification of the analog signal to be inputted to) and the result of the A/D conversion is inputted to the microcomputer (CPU) 5.
An input buffer 7 is a circuit to which so-called ON/OFF signals such as an "electric load signal", "idle signal" and "starter signal" are input to adjust those signals to adequate signal levels for the microcomputer (CPU) 5 to process. Those signals whose levels have been adjusted are also inputted to the microcomputer (CPU) 5 from time to time.
The microcomputer (CPU) 5 calculates a number of revolutions or rotations of the signal rotor 1, i.e., a number of engine revolutions, on the basis of the binary period of the signal wave-shaped through the wave-shaping circuit 4 and processes the various signals taken in through the A/D converter 6 and the input buffer 7, as necessary. Then, it outputs an injection signal and an ignition signal, respectively, for a fuel injection apparatus (not shown) and an ignition apparatus (not shown) so as to realize a preferable engine control corresponding to an engine condition at each time.
In order to decide controlled variables and control timing appropriately at each time in such engine electronic control system, it is necessary for the microcomputer (CPU) 5 itself to grasp at least the number of engine revolutions correctly. Then, for that end, it becomes essential to wave-shape the alternating analog signal induced by the electromagnetic pickup 3 into the binary signal which accurately corresponds to the alternating period.
However, the binary signal is not necessarily wave-shaped accurately corresponding to the alternating period of the analog signal because noise in the vehicle such as ignition noise is often superimposed on the induced alternating analog signal and such superimposed noise component disturbs the binary output of the comparator in the wave-shaping circuit 4. When the signal is not wave-shaped accurately, the number of engine revolutions calculated through the microcomputer (CPU) 5 becomes inaccurate, and as a result, the reliability of the electronic control system is greatly damaged.
A circuit shown in FIG. 13 is used as the wave-shaping circuit 4 to deal with such a problem in the past. In the wave-shaping circuit shown in FIG. 13, the alternating analog signal induced by the electromagnetic pickup 3 is input to an input terminal 41. The alternating analog signal input to the input terminal 41 is applied to an inverting input (-terminal) of a comparator 42 as a signal Sin. A comparison reference signal Vth is applied to a non-inverting input (+terminal) of the comparator 42. An output terminal 43 is a terminal for outputting a wave-shaped signal Sout wave-shaped by the comparator 42 to the microcomputer (CPU) 5.
In the wave-shaping circuit 4, a F/V (frequency to voltage) converting circuit 44, a dynamic hysteresis generating circuit 45, a first threshold generating circuit 46 and a second threshold generating circuit 47 are circuits for generating the comparison reference signal Vth applied to the non-inverting input (+terminal) of the comparator 42.
Among them, the F/V converting circuit 44 receives the wave-shaped signal Sout output from the comparator 42 to output a voltage converting signal Vfv which corresponds to the frequency of the signal Sout, i.e. the number of engine revolutions. The voltage converting signal Vfv is applied respectively to the dynamic hysteresis generating circuit 45 and the first threshold generating circuit 46.
The dynamic hysteresis generating circuit 45 generates a dynamic hysteresis current Im having a predetermined crest value and whose level attenuates at a speed proportional to a voltage value of the voltage converting signal Vfv output from the F/V converting circuit 44. FIG. 14 shows one example of the dynamic hysteresis generating circuit 45.
In the dynamic hysteresis generating circuit 45 shown in FIG. 14, a transistor Q11 turns on when the wave-shaped signal Sout output from the comparator 42 turns to a logic-L (low) level and a transistor Q12 turns on when the wave-shaped signal Sout turns to a logic-H (high) level. When the transistor Q11 turns on, a capacitor 451 having a capacitance Cm is started to be charged and when the transistor Q12 turns on, this electric charge is started to be discharged.
During the discharge, the discharge current Inm flows into a discharge control circuit 452 via the transistor Q12, wherein the amount of discharge is controlled on the basis of the voltage converting signal Vfv output from the F/V converting circuit 44.
The discharge control circuit 452 comprises, as shown in FIG. 15 for example, a constant-current source 4521, a resistor 4522, diodes 4523 and 4524 for adding voltages, a non-inverting amplifier 4525, a transistor 4526, a load resistor 4527 and a feedback diode 4528.
In the discharge control circuit 452, a constant-voltage Ic.times.Rc which is defined by the above-mentioned constant-current source 4521 and the resistor 4522 is applied to the load resistor 4527 until when the voltage converting signal Vfv reaches a voltage which corresponds to 150 rpm as shown in FIG. 16 for example. That is, in this case, the discharge current Inm described above becomes a constant current expressed as follows: EQU Inm=Ic.times.Rc/Rt
However, when the voltage converting signal Vfv exceeds the voltage which corresponds to 150 rpm of number for example, the voltage value of the voltage converting signal Vfv becomes dominant in the voltage applied to the load resistor 4527 and thereafter, the amount of the discharge current Inm also increases in proportion to the voltage value of the voltage converting signal Vfv as shown in FIG. 16 in a manner expressed as follows : EQU Inm=Vfv/Rt
That is, the discharge speed increases in proportion to the voltage value of the voltage converting signal Vfv.
In the dynamic hysteresis generating circuit 45 shown in FIG. 14, a transistor Q13 amplifies a capacitor voltage Vnm of the capacitor 451 and transistors Q14, Q15 and Q16 compose a base-current correcting current mirror circuit.
Accordingly, if a current Iref1 flows through a collector of the transistor Q13 as the voltage Vnm is amplified by the transistor Q13, a current Im equivalent to the current Iref1 starts to flow through a collector of the transistor Q16. Then, as shown in FIG. 17B, the level of those currents Iref1 and Im gradually attenuates or decreases from a certain crest value as the current Inm is discharged when the wave-shaped signal Sout shown in FIG. 17A is at the logic-H level. A mask time Tm accompanying this level of attenuation becomes shorter in proportion to the discharge speed of the discharge current Inm, i.e., in proportion to the number of engine revolutions. When the wave-shaped signal Sout turns to the logic-L level, a transistor Q17 turns on through an inverter 453, inhibiting the current Im from flowing out.
FIGS. 18A and 18B show voltage waveforms of a dynamic hysteresis voltage Vm formed by the current (dynamic hysteresis current) Im and a resistor 51 (shown in FIGS. 13 and 14). As shown in FIGS. 18A and 18B, this dynamic hysteresis voltage Vm also has the following characteristics:
a) its crest value is held at a constant value even if the number of engine revolutions changes; and PA1 b) the higher the number of engine revolutions, the shorter the mask time Tm becomes. A voltage Vf is a threshold voltage which is generated through the first threshold generating circuit 46 described below. A voltage to which the dynamic hysteresis voltage Vm and threshold voltage Vf are added becomes the comparison reference signal Vth described above.
The dynamic hysteresis voltage Vm is a voltage for masking a noise N1 when it is superimposed on an input signal (output of the electromagnetic pickup 3) Sin in a manner as shown in FIG. 20A by ignition noise shown in FIG. 19.
That is, while the wave-shaped signal Sout is output in a way of inviting an erroneous operation of the microcomputer 5 as shown in FIGS. 20A and 20B when no component of the dynamic hysteresis voltage Vm exists for the comparison reference signal Vth, the noise N1 is appropriately masked when the dynamic hysteresis voltage Vm exists as shown in FIGS. 20A and 20C, allowing an accurate wave-shaped signal Sout to be obtained.
In the wave-shaping circuit 4 shown in FIG. 13, the first threshold generating circuit 46 generates a threshold current If whose level increases and decreases in proportion to the voltage value of the voltage converting signal Vfv output from the F/V converting circuit 44. FIG. 21 shows one example of the circuit 46.
In the first threshold generating circuit 46 shown in FIG. 21, a transistor Q21 amplifies the voltage converting signal Vfv output from the F/V converting circuit 44 and transistors Q22, Q23 and Q24 compose a base-current correcting current mirror circuit.
Accordingly, if a current Iref2 flows through a collector of the transistor Q21 as the voltage converting signal Vfv is amplified by the transistor Q21, a current If equivalent to the current Iref2 flows through a collector of the transistor Q24. However, when this current If is below a certain current value, i.e., when the voltage converting signal Vfv takes a small value which is below a certain number of engine revolutions, the current If is absorbed by a constant-current source 461 (If=0) and the threshold voltage Vf generated through the current If becomes constant at a partial potential value (minimum value) of a potential dividing circuit comprising the resistors 50 and 51.
A transistor Q26 turns on when the voltage converting signal Vfv is above a partial potential value of a potential dividing circuit comprising resistors 462 and 463. Accordingly, when the voltage converting signal Vfv becomes above that partial potential value, i.e., when the number of engine revolutions becomes above the certain number of revolutions, the current If becomes constant at a current value (maximum value) defined by the partial potential value of the potential dividing circuit comprising the resistors 462 and 463 and the threshold voltage Vf also becomes constant at a value which corresponds to the maximum value of the current If.
After all, the level of the threshold current If output from the first threshold generating circuit 46 increases and decreases in a manner as shown in FIGS. 22A and 22B between the minimum and maximum values in proportion to the magnitude of the voltage converting signal Vfv, i.e., the number of engine revolutions, when the wave-shaped signal Sout is on the logic-H level. When the wave-shaped signal Sout turns to the logic-L level, a transistor Q25 turns on via an inverter 464, inhibiting the current If from flowing out.
FIG. 23 shows one example of a relationship between the threshold voltage Vf generated on the basis of the threshold current If and the number of engine revolutions (magnitude of the voltage converting signal Vfv).
As shown in the figure, the threshold voltage Vf takes a minimum value A1 when the number of engine revolutions is below 50 rpm for example and takes a maximum value A3 when the number of engine revolutions is above 2000 rpm. A value A2 therebetween increases and decreases in proportion to the number of engine revolutions. The lower limit value A1 of the threshold voltage Vf is normally set at a level on which no interference noise N2 superimposed in a manner as shown in FIG. 25 for example is detected when a plurality of electromagnetic pickups 3 and 3' are closely disposed as shown in FIG. 24 for example. FIG. 23 shows an area where this interference noise N2 or the like cannot be masked as an area B. On the other hand, the upper limit value A3 of the threshold voltage Vf is set at a level on which even a minimum output voltage of the electromagnetic pickup 3 can be detected. FIG. 23 shows an area where the minimum output voltage of the electromagnetic pickup 3 cannot be detected as an area C.
In the wave-shaping circuit 4 shown in FIG. 13, the second threshold generating circuit 47 generates the comparison reference signal Vth when the wave-shaped signal Sout is at the logic-L level.
That is, as shown in FIG. 13, when the wave-shaped signal Sout is on the logic-L level, a transistor 472 turns on through an inverter 471 in the second threshold generating circuit 47. Then, as the transistor 472 turns on, a potential dividing circuit comprising a resistor 473 in addition to the resistors 50 and 51 is formed and the comparison reference signal Vth is fixed by a partial potential value of the potential dividing circuit. This comparison reference signal Vth is used as a binary threshold voltage when the aforementioned alternating input signal Sin is at the positive side.
The wave-shaping circuit described above thus wave-shapes (binarizes) the input signal Sin in the condition wherein such noise component is well masked no matter when the ignition noise is superimposed or the interference noise between the pickups is superimposed on the input signal Sin.
However, because the wave-shaping circuit is arranged so as to form the comparison reference signal Vth by simply adding the dynamic hysteresis voltage Vm and the threshold voltage Vf described above through the diodes 48 and 49 when the wave-shaped signal Sout is at the logic-H level, it also has the following problem.
That is, as shown in FIGS. 26A and 26B, the level of the comparison reference signal Vth is maintained almost at the appropriate signal level even when the dynamic hysteresis voltage Vm and the threshold voltage Vf are added when the number of engine revolutions is relatively low. However, when the number of engine revolutions is high, the level of the comparison reference signal Vth is sufficiently raised and an accurate wave-shaping is not necessarily maintained, failing to detect the minimum output voltage of the electromagnetic pickup 3 for example (marked by a broken line A3' in FIG. 23).
As described before that, when it cannot correctly detect even the minimum output voltage of the electromagnetic pickup 3, the number of engine revolutions calculated through the microcomputer (CPU) 5 naturally takes an erroneous value, greatly damaging the reliability of the electronic control system.